home *** CD-ROM | disk | FTP | other *** search
-
- // JavaScript sample demonstrating r3Browsegadget (file control)
- // Copyrights 2004, Realsoft Graphics Oy
-
- // --- include java script classes ---
-
- include("oops/r3window.js");
- include("oops/r3packer.js");
- include("oops/r3text.js");
- include("real/gadget/r3browgd.js");
-
- {
-
- function myFileHook(obj, event, value)
- {
- obj.info.SetText("You selected file " + value);
- }
-
- // --- create a new window, as usual ---
-
- window = new r3Window(R3WGA_Parent, _r3gui,
- R3WGA_Left, 200,
- R3WGA_Top, 100,
- R3WA_Title, "Callback Sample",
- R3WA_ReportCloseWindow, TRUE,
- R3WA_ReportNewSize, TRUE);
-
- info = new r3Text(R3WGA_Parent, window,
- R3GA_Text, "Info",
- R3GTA_Text, "Welcome to JavaScript", // current value
- R3GTA_Border, TRUE);
-
- browse = new r3Browsegadget(R3WGA_Parent, window,
- R3BRGA_BrowsePrompt, "Save file",
- R3BRGA_NoUserInterface, FALSE,
- R3FLA_Action, R3FLACTION_GETSAVEFILENAME,
- R3GA_Text, "File",
- R3GA_ToolTip, "Select a file",
- R3RA_Hook, myFileHook);
-
- browse.info = info;
-
-
-
- // --- Design layout for the GUI ----
-
- packer = new r3Packer(R3PA_Orientation, R3PAOF_VERTICAL);
-
- packer.ADD(R3PAPF_FILLX, R3PAAF_ALIGN, browse);
- packer.ADD(R3PAPF_FILLX, R3PAAF_ALIGN, info);
-
- window.SetGmanager(packer);
-
- // --- compute native size, show ---
-
- window.FIT(R3WFP_BESTFIT);
- window.REALIZE();
- }
-
-